/**
 * All the functions needed for the static objects
 *
 * Originally written by: Jonas Strandstedt
 *
 */


/**
 * object_hover_rotate hovers and rotates object like quake powerups
 */
void object_hover_rotate(CollisionObject *obj) {
	if (obj->lastCollision == 0) {
		float time = glfwGetTime();
		
		obj->angle.z += 0.05;
		obj->pos.z = fabsf(sin(time*2));
		
		obj->visible = 1;
	} else {
		obj->lastCollision--;
	}
	
	 
}

/**
 * object_buoy moves object like a bouy
 */
void object_buoy(CollisionObject *obj) {
	
	if (obj->lastCollision == 0) {
		float time = glfwGetTime();
		
		obj->angle.y = sin(time + obj->pos.x + obj->pos.y)/6;
		obj->angle.x = sin(time + obj->pos.x + obj->pos.y)/7;
		//obj->pos.z = fabsf(sin(time*2))/3 - 0.3;
		obj->pos.z = sin(time + obj->pos.x + obj->pos.y)*0.3;	
		
		obj->visible = 1;
	} else {
		obj->lastCollision--;
	}
	
}

/**
 * object_eight
 */
void object_eight(CollisionObject *obj) {
	float time = glfwGetTime();
	
	obj->pos.y = obj->pos_orig.y + 4*sin(2*time);
	obj->pos.x = obj->pos_orig.x + 8*cos(time);
	
}

void bullet_bouy(Bullet *obj) {
	float time = glfwGetTime();
	
	obj->angle.y = sin(time + obj->pos.x + obj->pos.y)/6;
	obj->angle.x = sin(time + obj->pos.x + obj->pos.y)/7;
	obj->pos.z = fabsf(sin(time*2))/3 - 0.4;
}

void object_water (CollisionObject *obj) {

	
}